<template>
  <div class="home-swiper">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item, index) in banners" :key="index">
        <van-image v-lazy="item.imageUrl" :src="item.imageUrl" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
<script>
export default {
  
  data() {
    return {
      banners: [],
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      this.$request("get", "/banner").then((res) => {
        console.log(res);
        this.banners = res.banners;
      });
    },
  },
};
</script>
<style scoped>

.my-swipe .van-swipe-item van-img {
  width: 100%;
  border-radius: 1rem;
}
</style>